package com.ruoyi.goodsDetail.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 商品订单详情信息对象 wdm_order_goods_detail
 * 
 * @author ruoyi
 * @date 2025-06-05
 */
@Data
public class OrderGoodsDetail extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 详情ID */
    private Long detailId;

    /** 详情号 */
    @Excel(name = "详情号")
    private String detailCode;

    /** 订单ID */
    @Excel(name = "订单ID")
    private Long orderId;

    /** 商品ID */
    @Excel(name = "商品ID")
    private Long goodsId;

    /** 商品名称（快照） */
    @Excel(name = "商品名称", readConverterExp = "快=照")
    private String goodsName;

    /** 商品主图（快照） */
    @Excel(name = "商品主图", readConverterExp = "快=照")
    private String mainImage;

    /** 下单时单价（快照） */
    @Excel(name = "下单时单价", readConverterExp = "快=照")
    private BigDecimal unitPrice;

    /** 购买数量 */
    @Excel(name = "购买数量")
    private Long quantity;

    /** 子项金额（unit_price × quantity） */
    @Excel(name = "子项金额", readConverterExp = "u=nit_price,×=,q=uantity")
    private BigDecimal subtotal;

    /** 商品规格 */
    @Excel(name = "商品规格")
    private String specs;

    /** 生产日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date productionDate;

    /** 过期日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "过期日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expireDate;

    /** 状态 */
    @Excel(name = "状态")
    private String status;

    /** 删除 */
    private String delFlag;

    /** 版本号 */
    private Long version;

    private Long skuId;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("detailId", getDetailId())
            .append("detailCode", getDetailCode())
            .append("orderId", getOrderId())
            .append("goodsId", getGoodsId())
            .append("goodsName", getGoodsName())
            .append("mainImage", getMainImage())
            .append("unitPrice", getUnitPrice())
            .append("quantity", getQuantity())
            .append("subtotal", getSubtotal())
            .append("specs", getSpecs())
            .append("productionDate", getProductionDate())
            .append("expireDate", getExpireDate())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("version", getVersion())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("createBy", getCreateBy())
            .append("updateBy", getUpdateBy())
            .append("remark", getRemark())
            .append("skuId", getSkuId())
            .toString();
    }
}
